package calculator;

public class DivisionExpression extends BinaryExpression {

	public DivisionExpression(IExpression left, IExpression right)
	{
		super(left, right);
	}

	@Override
	public Double calculate() {
		if (right.calculate() == 0)
		{
			throw new RuntimeException("Division by zero not possible");
		}
		return left.calculate() / right.calculate();
	}

}
